from django.db import models

# Create your models here.


class User(models.Model):

    username = models.CharField(max_length=64, unique=True, null=False, verbose_name='用户名')
    password = models.CharField(max_length=64, verbose_name='用户密码', null=False)

class Item(models.Model):

    choiceitem = [('available', 'available'), ('sold', 'sold')]

    title = models.CharField(max_length=225, null=False, verbose_name='物品标题')
    price = models.DecimalField(max_digits=10, decimal_places=2, null=False, verbose_name='物品价格')
    seller_id = models.ForeignKey(User, on_delete=models.CASCADE, related_name='user', verbose_name='外键，关联用户ID')
    status = models.CharField(max_length=64, choices=choiceitem, default='available', verbose_name='物品状态')










